package ink.tiptop.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author ink.tiptop.zjf
 * @Title: Ticket
 * @Package ink.tiptop.common.config
 * @Description:
 * @date 2020-06-26 10:25
 */
public class ContextHolder {

    private static ThreadLocal<HttpServletRequest> localRequest = new ThreadLocal<>();

    private static ThreadLocal<HttpServletResponse> localResponse = new ThreadLocal<>();

    public static void setLocalRequest(HttpServletRequest request) {
        localRequest.set(request);
    }
    public static void setLocalResponse(HttpServletResponse response) {
        localResponse.set(response);
    }

    public static ThreadLocal<HttpServletRequest> getLocalRequest() {
        return localRequest;
    }

    public static ThreadLocal<HttpServletResponse> getLocalResponse() {
        return localResponse;
    }
}
